import React, { useState } from 'react';

const ThinkingBlock: React.FC<{ text: string }> = ({ text }) => {
  const [open, setOpen] = useState(false);
  return (
    <div style={{ margin: '8px 0' }}>
      <a onClick={() => setOpen(!open)}>{open ? '收起思考过程' : '展开思考过程'}</a>
      {open && (
        <div className="bubble" style={{ marginTop: 8 }}>
          <pre style={{ margin: 0 }}><code>{text}</code></pre>
        </div>
      )}
    </div>
  );
};

export default ThinkingBlock;

